home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 6 code / TCP / finger / TCPHi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-03  |  4.5 KB  |  96 lines  |  [TEXT/MPS ]

  1. #ifndef _TCPLOW_
  2. #define _TCPLOW_
  3.  
  4. /* network initialization ------------------------------------------------------*/
  5.  
  6. OSErr InitNetwork(void);        /* opens the network driver */
  7.  
  8.  
  9. /* connection stream creation/removal -------------------------------------------*/
  10.  
  11. OSErr CreateStream(                /* creates a stream needed to establish a connection*/
  12.     unsigned long *stream,            /* stream identifier (returned)                    */
  13.     unsigned long recvLen);            /* stream buffer length to be allocated            */
  14.     
  15. OSErr ReleaseStream(            /* disposes of an unused stream and its buffers        */
  16.     unsigned long stream);            /* stream identifier to dispose                    */
  17.  
  18.  
  19. /* connection opening/closing calls ---------------------------------------------*/
  20.  
  21. OSErr OpenConnection(            /* attempts to establish a connection w/remote host */
  22.     unsigned long stream,            /* stream id to be used for connection            */
  23.     long remoteHost,                /* network number of remote host                */
  24.     short remotePort,                /* network port of remote port                    */
  25.     Byte timeout);                    /* timeout value for connection                    */
  26.     
  27. OSErr WaitForConnection(        /* listens for a remote connection from a rem. port */
  28.     unsigned long stream,            /* stream id to be used for connection            */
  29.     Byte timeout,                    /* timeout value for open                        */
  30.     short localPort,                /* local port to listen on                        */
  31.     long *remoteHost,                /* remote host connected to (returned)            */
  32.     short *remotePort);                /* remote port connected to (returned)            */
  33.  
  34. void AsyncWaitForConnection(    /* same as above, except executed asynchronously    */
  35.     unsigned long stream,            /* stream id to be used for connection            */
  36.     Byte timeout,                    /* timeout value for open                        */
  37.     short localPort,                /* local port to listen on                        */
  38.     long remoteHost,                /* remote host to listen for                    */
  39.     short remotePort,                /* remote port to listen for                    */
  40.     TCPiopb **returnBlock);            /* parameter block for call (returned)            */
  41.  
  42. OSErr AsyncGetConnectionData(    /* retrieves connection data for above call            */
  43.     TCPiopb *returnBlock,            /* parameter block for asyncwait call            */
  44.     long *remoteHost,                /* remote host connected to (returned)            */
  45.     short *remotePort);                /* remote port connected to (returned)            */
  46.  
  47. OSErr CloseConnection(            /* closes an established connection                    */
  48.     unsigned long stream);            /* stream id of stream used for connection        */
  49.     
  50. OSErr AbortConnection(            /* aborts a connection non-gracefully                */
  51.     unsigned long stream);            /* stream id of stream used for connection        */
  52.  
  53.  
  54. /* data sending calls ----------------------------------------------------------*/
  55.  
  56. OSErr SendData(                    /* sends data along an open connection                */
  57.     unsigned long stream,            /* stream used for connection                    */
  58.     Ptr data,                        /* pointer to data to send                        */
  59.     unsigned short length,            /* length of data to send                        */
  60.     Boolean retry);                    /* if true, call continues until send successful*/
  61.     
  62. OSErr SendMultiData(            /* sends multiple strings of data on a connection    */
  63.     unsigned long stream,            /* stream used for connection                    */
  64.     Str255 data[],                    /* array of send strings                        */    
  65.     short numData,                    /* number of strings to send                    */
  66.     Boolean retry);                    /* if true, call continues until send successful*/
  67.  
  68. void SendDataAsync(                /* sends data asynchronously                        */
  69.     unsigned long stream,            /* stream used for connection                    */
  70.     Ptr data,                        /* pointer to data to send                        */
  71.     unsigned short length,            /* length of data to send                        */
  72.     TCPiopb **returnBlock);            /* pointer to parameter block (returned)        */
  73.     
  74. OSErr SendAsyncDone(            /* called when SendDataAsync call completes            */
  75.     TCPiopb *returnBlock);            /* parameter block to complete connection        */
  76.  
  77.  
  78. /* data receiving calls --------------------------------------------------------*/
  79.  
  80. OSErr RecvData(                    /* waits for data to be received on a connection    */
  81.     unsigned long stream,            /* stream used for connection                    */ 
  82.     Ptr data,                        /* pointer to memory used to hold incoming data    */
  83.     unsigned short *length,            /* length to data received (returned)            */
  84.     Boolean retry);                    /* if true, call continues until successful        */
  85.     
  86. void RecvDataAsync(                /* receives data asynchronously                        */
  87.     unsigned long stream,            /* stream used for connection                    */
  88.     Ptr data,                        /* pointer to memory used to hold incoming data    */
  89.     unsigned short length,            /* length of data requested                        */
  90.     TCPiopb **returnBlock);            /* parameter block to complete connection        */
  91.     
  92. OSErr GetDataLength(            /* called when RecvDataAsync completes                */
  93.     TCPiopb *returnBlock,            /* parameter block used for receive                */
  94.     unsigned short *length);        /* length of data received (returned)            */
  95.  
  96. #endif _TCPLOW_